import 'package:FlipClock/controller/timer_controller.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

class HobbyTimeButton extends StatelessWidget {
  final double time;
  const HobbyTimeButton(this.time) : super();

  @override
  Widget build(BuildContext context) {
    TimerController tc = Get.put(TimerController());

    return Container(
      margin: EdgeInsets.only(left: 10, right: 10),
      child: TextButton(
        onPressed: () {
          tc.timerValue.value = time;
        },
        child: Text(
          "${time.truncate()} min",
          style: Theme.of(context).textTheme.subtitle1,
        ),
        style: Theme.of(context).textButtonTheme.style.copyWith(
            backgroundColor: MaterialStateProperty.all(Colors.transparent)),
      ),
    );
  }
}
